#pragma once

#include "IXFileMapBuffer.h"

/**
 *  Interface used to read XFile.
 *
 */
class ExportXSkinLib IXFileReader : public IXBaseObj
{
    DEF_INTERFACE(IXFileReader, _T("{DCEF8D1A-3E4A-4a02-BA50-742CA40C0074}"));
public:

    /**
    *  Open XFile.
    *
    *  @param szXNC     Path of the XFile, can be format of "@root:path"
    *
    */
    virtual HRESULT STDMETHODCALLTYPE   put_XNC(IN LPCTSTR szXNC) = 0;

    /**
     *  Load objects in XFile.
     *
     *  @param szObjectName     Name of the object.
     *  @param pBuffer          Receive content of the object.
     *
     */
    virtual HRESULT STDMETHODCALLTYPE   LoadObject(IN LPCTSTR szObjectName, OUT IXFileMapBuffer** pBuffer) = 0;

    /**
    *  Enumrate object name.
    *
    *  @param pos               Position of the object.
    *  @param bstrObjectName    Name of the object.
    *
    */
    virtual HRESULT STDMETHODCALLTYPE   EnumObject(IN OUT DWORD pos, OUT BSTR* bstrObjectName) = 0;

    /**
    *  Get count of objects.
    *
    *
    */
    virtual DWORD   STDMETHODCALLTYPE   GetObjectCount() = 0;

    virtual BOOL    STDMETHODCALLTYPE   IsFileExists(IN LPCTSTR szFilePath) = 0;
    virtual BOOL    STDMETHODCALLTYPE   IsFolderExists(IN LPCTSTR szFolderPath) = 0;
};
